1. Field of the Invention
The invention relates generally to microprocessors and, more specifically, to a method and system to perform shifting and rounding operations within a microprocessor, such as, for example, a digital signal processor, during execution of a single instruction.
2. Background
Typically, computer systems include one or more microprocessor devices, each microprocessor device being configured to perform operations on values stored within a memory of the computer system and to manage the overall operation of the computer system. These computer systems may also include various multimedia devices, such as, for example, sound cards and/or video cards, each multimedia device further including one or more processors, such as, for example, digital signal processors (DSPs), which perform complex mathematical computations within each respective multimedia device.
A digital signal processor (DSP) typically includes hardware execution units specifically configured to perform such mathematical calculations, such as, for example, one or more arithmetic logic units (ALU), one or more multiply-and-accumulate units (MAC), and other functional units configured to perform operations specified by a set of instructions within the DSP. Such operations may include, for example, arithmetic operations, logical operations, and other data processing operations, each being defined by an associated set of instructions.
Generally, the execution units within the DSP read data and operands from a register file coupled to the memory and to the execution units, perform the instruction operations, and store the results into the register file. The register file includes multiple register units, each register unit being accessible as a single register or as aligned pairs of two adjacent register units. Within each register unit, the execution units may perform, for example, specific data shifting and rounding operations using known shifting and rounding modules.